import request from '@/utils/request'

export function findByGroup(params) {
  return request({
    url: '/v1/filesUpload/findByPage',
    method: 'get',
    params
  })
}

export function save(data) {
  return request({
    url: '/v1/filesUpload/save',
    method: 'post',
    data: {
      groupId: data.groupId,
      type: data.fileType,
      explain: data.explain,
      fileCode: data.fileCode
    }
  })
}

export function download(fileCode, fileName) {
  return request({
    url: '/v1/filesUpload/download',
    method: 'get',
    params: {
      fileCode: fileCode,
      fileName: fileName
    },
    responseType: 'blob'
  })
}
